Import library


In [27]:
from pyCMR.pyCMR import CMR

In [28]:
# Instantiate CMR object by providing a local configuration file.

In [29]:
cmr=CMR("../cmr.cfg")

Search collection using keyword and data center


In [30]:
results = cmr.searchCollection(keyword='land&surface&reflectance',data_center='modaps')
print(len(results))

for res in results:
    print(res['data_center']+' - '+res['title']+' - '+res['short_name'])


0

Search granules using shortname and date range


In [31]:
results = cmr.searchGranule(limit=1000,short_name="MOD09CMG",temporal="2010-02-01T10:00:00Z,2010-02-01T12:00:00Z")

for res in results:
    print(res.getDownloadUrl())
    res.download()